
GO 
USE [OEOF_GX]
GO

/****** Object:  Table [dbo].[T_DIC_GENCATETYPE]    Script Date: 03/23/2017 14:31:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[T_DIC_GENCATETYPE](
	[CATEGORYCLASS] [nvarchar](50) NOT NULL,
	[CATEGORYNAME] [nvarchar](50) NULL,
 CONSTRAINT [PK_T_DIC_GENCATETYPE] PRIMARY KEY NONCLUSTERED 
(
	[CATEGORYCLASS] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'类别分类' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_DIC_GENCATETYPE', @level2type=N'COLUMN',@level2name=N'CATEGORYCLASS'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分类中文名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_DIC_GENCATETYPE', @level2type=N'COLUMN',@level2name=N'CATEGORYNAME'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'字典-通用类别字典类型表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_DIC_GENCATETYPE'
GO

/****** Object:  Table [dbo].[T_DIC_GENERALCATEGORY]    Script Date: 03/23/2017 14:31:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[T_DIC_GENERALCATEGORY](
	[GENERALCODE] [nvarchar](50) NOT NULL,
	[CATEGORYNAME] [nvarchar](500) NULL,
	[CATEGORYCLASS] [nvarchar](50) NULL,
	[ORDERNUM] [int] NULL,
	[CSTATUS] [int] NULL,
	[REMARK] [nvarchar](50) NULL,
 CONSTRAINT [PK_T_DIC_GENERALCATEGORY] PRIMARY KEY NONCLUSTERED 
(
	[GENERALCODE] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'通用代码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_DIC_GENERALCATEGORY', @level2type=N'COLUMN',@level2name=N'GENERALCODE'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'类别名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_DIC_GENERALCATEGORY', @level2type=N'COLUMN',@level2name=N'CATEGORYNAME'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'类别分类' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_DIC_GENERALCATEGORY', @level2type=N'COLUMN',@level2name=N'CATEGORYCLASS'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排序' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_DIC_GENERALCATEGORY', @level2type=N'COLUMN',@level2name=N'ORDERNUM'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'状态,1正常0停用' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_DIC_GENERALCATEGORY', @level2type=N'COLUMN',@level2name=N'CSTATUS'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_DIC_GENERALCATEGORY', @level2type=N'COLUMN',@level2name=N'REMARK'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'包含通用字典数据，单位代码、水域功能区、企业规模，企业登记注册类型，燃烧方式，废水排放去向，废气排放规律，控制级别' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_DIC_GENERALCATEGORY'
GO

/****** Object:  Table [dbo].[T_BAS_SYS_LOG]    Script Date: 03/23/2017 14:31:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[T_BAS_SYS_LOG](
	[LOGID] [int] IDENTITY(1,1) NOT NULL,
	[LOGTIME] [datetime] NULL,
	[USERID] [int] NULL,
	[MODULE] [nvarchar](40) NULL,
	[OPERATORIP] [nvarchar](40) NULL,
	[LOGTYPE] [nvarchar](2) NULL,
	[LOGCONTENT] [nvarchar](1024) NULL,
 CONSTRAINT [PK_T_BAS_SYS_LOG] PRIMARY KEY NONCLUSTERED 
(
	[LOGID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'日志ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_SYS_LOG', @level2type=N'COLUMN',@level2name=N'LOGID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'日志时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_SYS_LOG', @level2type=N'COLUMN',@level2name=N'LOGTIME'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_SYS_LOG', @level2type=N'COLUMN',@level2name=N'USERID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模块' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_SYS_LOG', @level2type=N'COLUMN',@level2name=N'MODULE'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'操作IP' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_SYS_LOG', @level2type=N'COLUMN',@level2name=N'OPERATORIP'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'日志类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_SYS_LOG', @level2type=N'COLUMN',@level2name=N'LOGTYPE'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'日志内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_SYS_LOG', @level2type=N'COLUMN',@level2name=N'LOGCONTENT'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'包含用户登录，操作相关操作' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_SYS_LOG'
GO

/****** Object:  Table [dbo].[T_BAS_USERBUTTON]    Script Date: 03/23/2017 14:31:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[T_BAS_USERBUTTON](
	[ID] [int] NOT NULL,
	[BUTTONNAME] [nvarchar](100) NULL,
	[URL] [nvarchar](100) NULL,
	[CREATETIME] [datetime] NULL,
 CONSTRAINT [PK_T_BAS_USERBUTTON] PRIMARY KEY NONCLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USERBUTTON', @level2type=N'COLUMN',@level2name=N'ID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'按钮名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USERBUTTON', @level2type=N'COLUMN',@level2name=N'BUTTONNAME'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'链接地址' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USERBUTTON', @level2type=N'COLUMN',@level2name=N'URL'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USERBUTTON', @level2type=N'COLUMN',@level2name=N'CREATETIME'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'公共业务用户权限-用户按钮配置表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USERBUTTON'
GO


/****** Object:  Table [dbo].[T_BAS_ROLEButton]    Script Date: 03/23/2017 14:31:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[T_BAS_ROLEButton](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[BUTTONNAME] [nvarchar](100) NULL,
	[URL] [nvarchar](100) NULL,
	[CREATETIME] [datetime] NULL,
 CONSTRAINT [PK_T_BAS_ROLEBUTTON] PRIMARY KEY NONCLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_ROLEButton', @level2type=N'COLUMN',@level2name=N'ID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'按钮名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_ROLEButton', @level2type=N'COLUMN',@level2name=N'BUTTONNAME'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'链接地址' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_ROLEButton', @level2type=N'COLUMN',@level2name=N'URL'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_ROLEButton', @level2type=N'COLUMN',@level2name=N'CREATETIME'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'公共业务用户权限-角色按钮配置表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_ROLEButton'
GO

/****** Object:  Table [dbo].[T_BAS_ROLE]    Script Date: 03/23/2017 14:31:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[T_BAS_ROLE](
	[ROLEID] [int] IDENTITY(1,1) NOT NULL,
	[ROLENAME] [nvarchar](100) NULL,
	[CREATEID] [int] NULL,
	[CREATETIME] [datetime] NULL,
	[DESCRIPTION] [nvarchar](100) NULL,
	[DEPTID] [int] NULL,
 CONSTRAINT [PK_T_BAS_ROLE] PRIMARY KEY NONCLUSTERED 
(
	[ROLEID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'角色ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_ROLE', @level2type=N'COLUMN',@level2name=N'ROLEID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'角色名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_ROLE', @level2type=N'COLUMN',@level2name=N'ROLENAME'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建人ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_ROLE', @level2type=N'COLUMN',@level2name=N'CREATEID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_ROLE', @level2type=N'COLUMN',@level2name=N'CREATETIME'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'描述' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_ROLE', @level2type=N'COLUMN',@level2name=N'DESCRIPTION'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'所属部门ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_ROLE', @level2type=N'COLUMN',@level2name=N'DEPTID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'公共业务用户权限-角色信息表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_ROLE'
GO


/****** Object:  Table [dbo].[T_BAS_MENU]    Script Date: 03/23/2017 14:31:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[T_BAS_MENU](
	[MENUID] [int] IDENTITY(1,1) NOT NULL,
	[MENUNAME] [nvarchar](100) NULL,
	[MENUURL] [nvarchar](100) NULL,
	[MENUPIC] [nvarchar](200) NULL,
	[PID] [int] NULL,
	[MENUCODE] [nvarchar](50) NULL,
	[STYPE] [int] NULL,
	[ORDERNUM] [int] NULL,
	[MSTATUS] [int] NULL,
 CONSTRAINT [PK_T_BAS_MENU] PRIMARY KEY NONCLUSTERED 
(
	[MENUID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'菜单ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_MENU', @level2type=N'COLUMN',@level2name=N'MENUID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'菜单名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_MENU', @level2type=N'COLUMN',@level2name=N'MENUNAME'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'菜单URL' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_MENU', @level2type=N'COLUMN',@level2name=N'MENUURL'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'菜单图片路径' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_MENU', @level2type=N'COLUMN',@level2name=N'MENUPIC'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'父级菜单ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_MENU', @level2type=N'COLUMN',@level2name=N'PID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'菜单系统编码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_MENU', @level2type=N'COLUMN',@level2name=N'MENUCODE'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_MENU', @level2type=N'COLUMN',@level2name=N'STYPE'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排序' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_MENU', @level2type=N'COLUMN',@level2name=N'ORDERNUM'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'状态1启用0停用' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_MENU', @level2type=N'COLUMN',@level2name=N'MSTATUS'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'菜单权限表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_MENU'
GO



/****** Object:  Table [dbo].[T_BAS_SESSION]    Script Date: 03/23/2017 14:31:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[T_BAS_SESSION](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[SESSIONID] [nvarchar](50) NOT NULL,
	[SESSIONNAME] [nvarchar](50) NOT NULL,
	[SESSIONCONTENT] [nvarchar](1000) NOT NULL,
	[EXPIRINGDATE] [datetime2](7) NOT NULL,
	[USERID] [int] NOT NULL,
 CONSTRAINT [PK_T_BAS_SESSION] PRIMARY KEY NONCLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'过期时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_SESSION', @level2type=N'COLUMN',@level2name=N'EXPIRINGDATE'
GO

/****** Object:  Table [dbo].[T_BAS_BUTTON]    Script Date: 03/23/2017 14:31:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[T_BAS_BUTTON](
	[BUTTONID] [int] IDENTITY(1,1) NOT NULL,
	[BUTTONCODE] [nvarchar](100) NULL,
	[BUTTONNAME] [nvarchar](50) NULL,
	[ORDERNUM] [int] NULL,
 CONSTRAINT [PK_T_BAS_BUTTON] PRIMARY KEY NONCLUSTERED 
(
	[BUTTONID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'按钮ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_BUTTON', @level2type=N'COLUMN',@level2name=N'BUTTONID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'按钮代码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_BUTTON', @level2type=N'COLUMN',@level2name=N'BUTTONCODE'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'按钮名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_BUTTON', @level2type=N'COLUMN',@level2name=N'BUTTONNAME'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排序' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_BUTTON', @level2type=N'COLUMN',@level2name=N'ORDERNUM'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'按钮权限表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_BUTTON'
GO

/****** Object:  Table [dbo].[T_BAS_DEPTINFO]    Script Date: 03/23/2017 14:31:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[T_BAS_DEPTINFO](
	[DEPTID] [int] IDENTITY(1,1) NOT NULL,
	[PDEPTID] [int] NULL,
	[DEPTNAME] [nvarchar](40) NULL,
	[DEPTDESC] [nvarchar](500) NULL,
	[DEPTLEADERID] [int] NULL,
	[CREATEID] [int] NULL,
	[CREATETIME] [datetime] NULL,
	[ROLEID] [int] NULL,
	[SEDDEPTCODE] [nvarchar](50) NULL,
 CONSTRAINT [PK_T_BAS_DEPTINFO] PRIMARY KEY NONCLUSTERED 
(
	[DEPTID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'部门ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_DEPTINFO', @level2type=N'COLUMN',@level2name=N'DEPTID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'所属部门ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_DEPTINFO', @level2type=N'COLUMN',@level2name=N'PDEPTID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'部门名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_DEPTINFO', @level2type=N'COLUMN',@level2name=N'DEPTNAME'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'部门职能描述' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_DEPTINFO', @level2type=N'COLUMN',@level2name=N'DEPTDESC'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'部门负责人ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_DEPTINFO', @level2type=N'COLUMN',@level2name=N'DEPTLEADERID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建人ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_DEPTINFO', @level2type=N'COLUMN',@level2name=N'CREATEID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_DEPTINFO', @level2type=N'COLUMN',@level2name=N'CREATETIME'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'管理员角色ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_DEPTINFO', @level2type=N'COLUMN',@level2name=N'ROLEID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'标准部门code' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_DEPTINFO', @level2type=N'COLUMN',@level2name=N'SEDDEPTCODE'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'公共业务用户权限-部门信息表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_DEPTINFO'
GO

/****** Object:  Table [dbo].[T_BAS_FILEINFO]    Script Date: 03/23/2017 14:31:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[T_BAS_FILEINFO](
	[FILEID] [int] IDENTITY(1,1) NOT NULL,
	[ORGFILENAME] [varchar](200) NULL,
	[SERVERFILENAME] [varchar](50) NULL,
	[FILEPATH] [varchar](250) NULL,
	[FILESIZE] [float] NULL,
	[EXTNAME] [varchar](20) NULL,
	[FTYPE] [tinyint] NULL,
	[CTIME] [datetime] NULL,
	[CUSERID] [int] NULL,
	[REMARK] [varchar](200) NULL,
	[UPLOADTIME] [datetime] NULL,
	[UPUSERID] [int] NULL,
 CONSTRAINT [PK_T_BAS_FILEINFO] PRIMARY KEY NONCLUSTERED 
(
	[FILEID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文件id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_FILEINFO', @level2type=N'COLUMN',@level2name=N'FILEID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'源文件名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_FILEINFO', @level2type=N'COLUMN',@level2name=N'ORGFILENAME'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'服务器存储文件名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_FILEINFO', @level2type=N'COLUMN',@level2name=N'SERVERFILENAME'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'服务器存储路径' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_FILEINFO', @level2type=N'COLUMN',@level2name=N'FILEPATH'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文件大小字节' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_FILEINFO', @level2type=N'COLUMN',@level2name=N'FILESIZE'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文件扩展名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_FILEINFO', @level2type=N'COLUMN',@level2name=N'EXTNAME'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文件类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_FILEINFO', @level2type=N'COLUMN',@level2name=N'FTYPE'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'上传时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_FILEINFO', @level2type=N'COLUMN',@level2name=N'CTIME'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'上传用户' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_FILEINFO', @level2type=N'COLUMN',@level2name=N'CUSERID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_FILEINFO', @level2type=N'COLUMN',@level2name=N'REMARK'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'更新时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_FILEINFO', @level2type=N'COLUMN',@level2name=N'UPLOADTIME'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'更新用户' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_FILEINFO', @level2type=N'COLUMN',@level2name=N'UPUSERID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'记录用户上传服务器的文件信息' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_FILEINFO'
GO


/****** Object:  Table [dbo].[T_BAS_BUTTONMENU]    Script Date: 03/23/2017 14:31:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[T_BAS_BUTTONMENU](
	[BUTTONID] [int] NOT NULL,
	[MENUID] [int] NOT NULL,
 CONSTRAINT [PK_T_BAS_BUTTONMENU] PRIMARY KEY NONCLUSTERED 
(
	[BUTTONID] ASC,
	[MENUID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'按钮ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_BUTTONMENU', @level2type=N'COLUMN',@level2name=N'BUTTONID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'菜单id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_BUTTONMENU', @level2type=N'COLUMN',@level2name=N'MENUID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'按钮权限表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_BUTTONMENU'
GO

/****** Object:  Table [dbo].[T_BAS_ROLESOURCE]    Script Date: 03/23/2017 14:31:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[T_BAS_ROLESOURCE](
	[ROLEID] [int] NOT NULL,
	[SOURCEID] [nvarchar](50) NOT NULL,
	[CREATEID] [int] NULL,
	[CREATETIME] [datetime] NULL,
 CONSTRAINT [PK_T_BAS_ROLESOURCE] PRIMARY KEY NONCLUSTERED 
(
	[ROLEID] ASC,
	[SOURCEID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'角色ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_ROLESOURCE', @level2type=N'COLUMN',@level2name=N'ROLEID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'资源ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_ROLESOURCE', @level2type=N'COLUMN',@level2name=N'SOURCEID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建人ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_ROLESOURCE', @level2type=N'COLUMN',@level2name=N'CREATEID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_ROLESOURCE', @level2type=N'COLUMN',@level2name=N'CREATETIME'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'公共业务用户权限-角色资源信息表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_ROLESOURCE'
GO

/****** Object:  Table [dbo].[T_BAS_ROLEPNTENTER]    Script Date: 03/23/2017 14:31:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[T_BAS_ROLEPNTENTER](
	[ROLEID] [int] NOT NULL,
	[OBJID] [int] NOT NULL,
	[TYPE] [int] NOT NULL,
	[CREATETIME] [datetime] NULL,
	[CREATEID] [int] NULL,
 CONSTRAINT [PK_T_BAS_ROLEPNTENTER] PRIMARY KEY NONCLUSTERED 
(
	[ROLEID] ASC,
	[OBJID] ASC,
	[TYPE] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'角色ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_ROLEPNTENTER', @level2type=N'COLUMN',@level2name=N'ROLEID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'对象ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_ROLEPNTENTER', @level2type=N'COLUMN',@level2name=N'OBJID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'类型1测点2企业' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_ROLEPNTENTER', @level2type=N'COLUMN',@level2name=N'TYPE'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_ROLEPNTENTER', @level2type=N'COLUMN',@level2name=N'CREATETIME'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建人ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_ROLEPNTENTER', @level2type=N'COLUMN',@level2name=N'CREATEID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'角色和企业或者测点关系表，污染源的最小权限粒度是污染源企业，环境质量的是测点' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_ROLEPNTENTER'
GO

/****** Object:  Table [dbo].[T_BAS_ROLEMEUN]    Script Date: 03/23/2017 14:31:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[T_BAS_ROLEMEUN](
	[ROLEID] [int] NOT NULL,
	[MENUID] [int] NOT NULL,
	[BUTTONID] [int] NOT NULL,
	[TYPE] [int] NULL,
	[CREATETIME] [datetime] NULL,
	[CREATEID] [int] NULL,
 CONSTRAINT [PK_T_BAS_ROLEMEUN] PRIMARY KEY NONCLUSTERED 
(
	[ROLEID] ASC,
	[MENUID] ASC,
	[BUTTONID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'角色ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_ROLEMEUN', @level2type=N'COLUMN',@level2name=N'ROLEID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'对象ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_ROLEMEUN', @level2type=N'COLUMN',@level2name=N'MENUID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'按钮id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_ROLEMEUN', @level2type=N'COLUMN',@level2name=N'BUTTONID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'类型1菜单2按钮' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_ROLEMEUN', @level2type=N'COLUMN',@level2name=N'TYPE'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_ROLEMEUN', @level2type=N'COLUMN',@level2name=N'CREATETIME'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建人ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_ROLEMEUN', @level2type=N'COLUMN',@level2name=N'CREATEID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'这里的菜单包括菜单，按钮' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_ROLEMEUN'
GO




/****** Object:  Table [dbo].[T_BAS_USER]    Script Date: 03/23/2017 14:31:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[T_BAS_USER](
	[USERID] [int] IDENTITY(1,1) NOT NULL,
	[DEPTID] [int] NULL,
	[COMPID] [int] NULL,
	[USERNAME] [nvarchar](50) NULL,
	[LOGINNAME] [nvarchar](50) NULL,
	[LOGINPW] [nvarchar](50) NULL,
	[TEL] [nvarchar](20) NULL,
	[EMAIL] [nvarchar](50) NULL,
	[USTATUS] [int] NULL,
	[CREATEID] [int] NULL,
	[CREATETIME] [datetime] NULL,
	[UPDATEUSERID] [int] NULL,
	[UPDATETIME] [datetime] NULL,
	[INVALIDTIME] [datetime] NULL,
	[SKIN] [nvarchar](50) NULL,
 CONSTRAINT [PK_T_BAS_USER] PRIMARY KEY NONCLUSTERED 
(
	[USERID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USER', @level2type=N'COLUMN',@level2name=N'USERID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户所属部门ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USER', @level2type=N'COLUMN',@level2name=N'DEPTID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户姓名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USER', @level2type=N'COLUMN',@level2name=N'USERNAME'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户登录名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USER', @level2type=N'COLUMN',@level2name=N'LOGINNAME'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户登录密码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USER', @level2type=N'COLUMN',@level2name=N'LOGINPW'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户手机' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USER', @level2type=N'COLUMN',@level2name=N'TEL'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户邮箱' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USER', @level2type=N'COLUMN',@level2name=N'EMAIL'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'状态-1已删除 0 禁用 1正常' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USER', @level2type=N'COLUMN',@level2name=N'USTATUS'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建人ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USER', @level2type=N'COLUMN',@level2name=N'CREATEID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USER', @level2type=N'COLUMN',@level2name=N'CREATETIME'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'更新人id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USER', @level2type=N'COLUMN',@level2name=N'UPDATEUSERID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'更新时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USER', @level2type=N'COLUMN',@level2name=N'UPDATETIME'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'失效时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USER', @level2type=N'COLUMN',@level2name=N'INVALIDTIME'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'使用的皮肤' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USER', @level2type=N'COLUMN',@level2name=N'SKIN'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'公共业务用户权限-用户信息' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USER'
GO


/****** Object:  Table [dbo].[T_BAS_USERROLE]    Script Date: 03/23/2017 14:31:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[T_BAS_USERROLE](
	[USERID] [int] NOT NULL,
	[ROLEID] [int] NOT NULL,
	[CREATEID] [int] NULL,
	[CREATETIME] [datetime] NULL,
 CONSTRAINT [PK_T_BAS_USERROLE] PRIMARY KEY NONCLUSTERED 
(
	[USERID] ASC,
	[ROLEID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USERROLE', @level2type=N'COLUMN',@level2name=N'USERID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'角色ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USERROLE', @level2type=N'COLUMN',@level2name=N'ROLEID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建人ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USERROLE', @level2type=N'COLUMN',@level2name=N'CREATEID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USERROLE', @level2type=N'COLUMN',@level2name=N'CREATETIME'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'公共业务用户权限-用户所属角色信息' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USERROLE'
GO

/****** Object:  Table [dbo].[T_BAS_USERRESOURCE]    Script Date: 03/23/2017 14:31:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[T_BAS_USERRESOURCE](
	[USERID] [int] NOT NULL,
	[RESOURCEID] [nvarchar](50) NOT NULL,
	[ISUSED] [int] NULL,
	[CREATEID] [int] NULL,
	[CREATETIME] [datetime] NULL,
	[ORDERNUM] [int] NULL,
 CONSTRAINT [PK_T_BAS_USERRESOURCE] PRIMARY KEY NONCLUSTERED 
(
	[USERID] ASC,
	[RESOURCEID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USERRESOURCE', @level2type=N'COLUMN',@level2name=N'USERID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'资源ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USERRESOURCE', @level2type=N'COLUMN',@level2name=N'RESOURCEID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否使用' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USERRESOURCE', @level2type=N'COLUMN',@level2name=N'ISUSED'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建人ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USERRESOURCE', @level2type=N'COLUMN',@level2name=N'CREATEID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USERRESOURCE', @level2type=N'COLUMN',@level2name=N'CREATETIME'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'顺序' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USERRESOURCE', @level2type=N'COLUMN',@level2name=N'ORDERNUM'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'公共业务用户权限-用户资源信息表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USERRESOURCE'
GO

/****** Object:  Table [dbo].[T_BAS_USERPNTENTER]    Script Date: 03/23/2017 14:31:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[T_BAS_USERPNTENTER](
	[OBJID] [int] NOT NULL,
	[USERID] [int] NOT NULL,
	[TYPE] [nvarchar](50) NOT NULL,
	[CREATEID] [int] NULL,
	[CREATETIME] [datetime] NULL,
	[ORDERNUM] [int] NULL,
 CONSTRAINT [PK_T_BAS_USERPNTENTER] PRIMARY KEY NONCLUSTERED 
(
	[OBJID] ASC,
	[USERID] ASC,
	[TYPE] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'对象ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USERPNTENTER', @level2type=N'COLUMN',@level2name=N'OBJID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USERPNTENTER', @level2type=N'COLUMN',@level2name=N'USERID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'类型1测点2企业' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USERPNTENTER', @level2type=N'COLUMN',@level2name=N'TYPE'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建人ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USERPNTENTER', @level2type=N'COLUMN',@level2name=N'CREATEID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USERPNTENTER', @level2type=N'COLUMN',@level2name=N'CREATETIME'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'顺序' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USERPNTENTER', @level2type=N'COLUMN',@level2name=N'ORDERNUM'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户和企业或者测点关系表，污染源的最小权限粒度是污染源企业，环境质量的是测点' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USERPNTENTER'
GO

/****** Object:  Table [dbo].[T_BAS_USERMENU]    Script Date: 03/23/2017 14:31:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[T_BAS_USERMENU](
	[MENUID] [int] NOT NULL,
	[USERID] [int] NOT NULL,
	[BUTTONID] [int] NOT NULL,
	[CREATEID] [int] NULL,
	[CREATETIME] [datetime] NULL,
	[ORDERNUM] [int] NULL,
	[TYPE] [int] NULL,
 CONSTRAINT [PK_T_BAS_USERMENU] PRIMARY KEY NONCLUSTERED 
(
	[MENUID] ASC,
	[USERID] ASC,
	[BUTTONID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'菜单ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USERMENU', @level2type=N'COLUMN',@level2name=N'MENUID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USERMENU', @level2type=N'COLUMN',@level2name=N'USERID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'按钮id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USERMENU', @level2type=N'COLUMN',@level2name=N'BUTTONID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建人ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USERMENU', @level2type=N'COLUMN',@level2name=N'CREATEID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USERMENU', @level2type=N'COLUMN',@level2name=N'CREATETIME'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'顺序' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USERMENU', @level2type=N'COLUMN',@level2name=N'ORDERNUM'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'类型1菜单2按钮' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USERMENU', @level2type=N'COLUMN',@level2name=N'TYPE'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'这里的菜单包含菜单，按钮' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BAS_USERMENU'
GO

/****** Object:  View [dbo].[V_BAS_USER_PNTENTER]    Script Date: 03/23/2017 14:31:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[V_BAS_USER_PNTENTER] AS 
SELECT U.OBJID AS OBJID, U.USERID AS USERID, U.TYPE AS TYPE
  FROM T_BAS_USERPNTENTER U
UNION
SELECT R.OBJID AS OBJID, U.USERID AS USERID, R.TYPE AS TYPE
  FROM (T_BAS_ROLEPNTENTER R JOIN T_BAS_USERROLE U ON((R.ROLEID = U.ROLEID)))
GO

/****** Object:  View [dbo].[V_BAS_USER_MENU]    Script Date: 03/23/2017 14:31:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[V_BAS_USER_MENU] AS 
SELECT M.MENUID   AS MENUID,
       M.MENUNAME AS MENUNAME,
       M.MENUURL  AS MENUURL,
       M.MENUPIC  AS MENUPIC,
       M.PID      AS PID,
       M.MENUCODE AS MENUCODE,
       M.ORDERNUM AS ORDERNUM,
       M.MSTATUS  AS MSTATUS,
       U.USERID   AS USERID
  FROM ((T_BAS_MENU M JOIN T_BAS_ROLEMEUN R ON((R.MENUID = M.MENUID))) JOIN
        T_BAS_USERROLE U ON((R.ROLEID = U.ROLEID)))
UNION
SELECT M.MENUID   AS MENUID,
       M.MENUNAME AS MENUNAME,
       M.MENUURL  AS MENUURL,
       M.MENUPIC  AS MENUPIC,
       M.PID      AS PID,
       M.MENUCODE AS MENUCODE,
       M.ORDERNUM AS ORDERNUM,
       M.MSTATUS  AS MSTATUS,
       U.USERID   AS USERID
  FROM (T_BAS_MENU M JOIN T_BAS_USERMENU U ON((U.MENUID = M.MENUID)))
GO

/****** Object:  View [dbo].[V_BAS_BUTTON_USER]    Script Date: 03/23/2017 14:31:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE  VIEW [dbo].[V_BAS_BUTTON_USER] AS 
SELECT t1.BUTTONID   AS BUTTONID,
       t1.BUTTONCODE AS BUTTONCODE,
       t1.BUTTONNAME AS BUTTONNAME,
       t1.ORDERNUM   AS ORDERNUM,
       t2.MENUID     AS MENUID,
       t4.USERID     AS USERID
  FROM (((T_BAS_BUTTON t1 JOIN T_BAS_BUTTONMENU t2
        ON((t1.BUTTONID = t2.BUTTONID))) JOIN T_BAS_ROLEMEUN t3
        ON(((t3.BUTTONID = t2.BUTTONID) AND (t3.MENUID = t2.MENUID)))) JOIN
        T_BAS_USERROLE t4 ON((t4.ROLEID = t3.ROLEID)))
UNION
SELECT t1.BUTTONID   AS BUTTONID,
       t1.BUTTONCODE AS BUTTONCODE,
       t1.BUTTONNAME AS BUTTONNAME,
       t1.ORDERNUM   AS ORDERNUM,
       t2.MENUID     AS MENUID,
       t3.USERID     AS USERID
  FROM ((T_BAS_BUTTON t1 JOIN T_BAS_BUTTONMENU t2
        ON((t1.BUTTONID = t2.BUTTONID))) JOIN T_BAS_USERMENU t3
        ON((t3.BUTTONID = t2.BUTTONID)))
GO

/****** Object:  View [dbo].[V_BAS_USER_MENU]    Script Date: 2017/9/1 16:47:14 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER VIEW [dbo].[V_BAS_USER_MENU] AS 
SELECT M.MENUID   AS MENUID,
       M.MENUNAME AS MENUNAME,
       M.MENUURL  AS MENUURL,
       M.MENUPIC  AS MENUPIC,
       M.PID      AS PID,
       M.MENUCODE AS MENUCODE,
       M.ORDERNUM AS ORDERNUM,
       M.MSTATUS  AS MSTATUS,
	   M.STYPE AS STYPE,
       U.USERID   AS USERID
  FROM ((T_BAS_MENU M JOIN T_BAS_ROLEMEUN R ON((R.MENUID = M.MENUID))) JOIN
        T_BAS_USERROLE U ON((R.ROLEID = U.ROLEID)))
UNION
SELECT M.MENUID   AS MENUID,
       M.MENUNAME AS MENUNAME,
       M.MENUURL  AS MENUURL,
       M.MENUPIC  AS MENUPIC,
       M.PID      AS PID,
       M.MENUCODE AS MENUCODE,
       M.ORDERNUM AS ORDERNUM,
       M.MSTATUS  AS MSTATUS,
	   M.STYPE AS STYPE,
       U.USERID   AS USERID
  FROM (T_BAS_MENU M JOIN T_BAS_USERMENU U ON((U.MENUID = M.MENUID)))

GO

/****** Object:  Default [DF__T_BAS_MEN__MSTAT__7D98A078]    Script Date: 03/23/2017 14:31:37 ******/
ALTER TABLE [dbo].[T_BAS_MENU] ADD  CONSTRAINT [DF__T_BAS_MEN__MSTAT__7D98A078]  DEFAULT ((1)) FOR [MSTATUS]
GO
/****** Object:  Default [DF__T_BAS_ROL__BUTTO__08162EEB]    Script Date: 03/23/2017 14:31:37 ******/
ALTER TABLE [dbo].[T_BAS_ROLEMEUN] ADD  DEFAULT ((-1)) FOR [BUTTONID]
GO
/****** Object:  Default [DF__T_BAS_ROLE__TYPE__090A5324]    Script Date: 03/23/2017 14:31:37 ******/
ALTER TABLE [dbo].[T_BAS_ROLEMEUN] ADD  DEFAULT ((1)) FOR [TYPE]
GO
/****** Object:  Default [DF__T_BAS_ROLE__TYPE__0BE6BFCF]    Script Date: 03/23/2017 14:31:37 ******/
ALTER TABLE [dbo].[T_BAS_ROLEPNTENTER] ADD  DEFAULT ((1)) FOR [TYPE]
GO
/****** Object:  Default [DF__T_BAS_USE__USTAT__1293BD5E]    Script Date: 03/23/2017 14:31:37 ******/
ALTER TABLE [dbo].[T_BAS_USER] ADD  CONSTRAINT [DF__T_BAS_USE__USTAT__1293BD5E]  DEFAULT ((1)) FOR [USTATUS]
GO
/****** Object:  Default [DF__T_BAS_USE__BUTTO__1758727B]    Script Date: 03/23/2017 14:31:37 ******/
ALTER TABLE [dbo].[T_BAS_USERMENU] ADD  DEFAULT ((-1)) FOR [BUTTONID]
GO
/****** Object:  Default [DF__T_BAS_USER__TYPE__184C96B4]    Script Date: 03/23/2017 14:31:37 ******/
ALTER TABLE [dbo].[T_BAS_USERMENU] ADD  DEFAULT ((1)) FOR [TYPE]
GO
/****** Object:  Default [DF__T_BAS_USER__TYPE__1B29035F]    Script Date: 03/23/2017 14:31:37 ******/
ALTER TABLE [dbo].[T_BAS_USERPNTENTER] ADD  DEFAULT ('1') FOR [TYPE]
GO
/****** Object:  ForeignKey [FK_T_BAS_BM_R_T_BAS_B]    Script Date: 03/23/2017 14:31:37 ******/
ALTER TABLE [dbo].[T_BAS_BUTTONMENU]  WITH CHECK ADD  CONSTRAINT [FK_T_BAS_BM_R_T_BAS_B] FOREIGN KEY([BUTTONID])
REFERENCES [dbo].[T_BAS_BUTTON] ([BUTTONID])
GO
ALTER TABLE [dbo].[T_BAS_BUTTONMENU] CHECK CONSTRAINT [FK_T_BAS_BM_R_T_BAS_B]
GO
/****** Object:  ForeignKey [FK_T_BAS_BM_R_T_BAS_M]    Script Date: 03/23/2017 14:31:37 ******/
ALTER TABLE [dbo].[T_BAS_BUTTONMENU]  WITH CHECK ADD  CONSTRAINT [FK_T_BAS_BM_R_T_BAS_M] FOREIGN KEY([MENUID])
REFERENCES [dbo].[T_BAS_MENU] ([MENUID])
GO
ALTER TABLE [dbo].[T_BAS_BUTTONMENU] CHECK CONSTRAINT [FK_T_BAS_BM_R_T_BAS_M]
GO
/****** Object:  ForeignKey [FK_T_BAS_RO_REFERENCE_T_BAS_ME]    Script Date: 03/23/2017 14:31:37 ******/
ALTER TABLE [dbo].[T_BAS_ROLEMEUN]  WITH CHECK ADD  CONSTRAINT [FK_T_BAS_RO_REFERENCE_T_BAS_ME] FOREIGN KEY([MENUID])
REFERENCES [dbo].[T_BAS_MENU] ([MENUID])
GO
ALTER TABLE [dbo].[T_BAS_ROLEMEUN] CHECK CONSTRAINT [FK_T_BAS_RO_REFERENCE_T_BAS_ME]
GO
/****** Object:  ForeignKey [FK_T_BAS_RO_REFERENCE_T_BAS_RO]    Script Date: 03/23/2017 14:31:37 ******/
ALTER TABLE [dbo].[T_BAS_ROLEMEUN]  WITH CHECK ADD  CONSTRAINT [FK_T_BAS_RO_REFERENCE_T_BAS_RO] FOREIGN KEY([ROLEID])
REFERENCES [dbo].[T_BAS_ROLE] ([ROLEID])
GO
ALTER TABLE [dbo].[T_BAS_ROLEMEUN] CHECK CONSTRAINT [FK_T_BAS_RO_REFERENCE_T_BAS_RO]
GO
/****** Object:  ForeignKey [FK_T_BAS_RE_R_T_BAS_R]    Script Date: 03/23/2017 14:31:37 ******/
ALTER TABLE [dbo].[T_BAS_ROLEPNTENTER]  WITH CHECK ADD  CONSTRAINT [FK_T_BAS_RE_R_T_BAS_R] FOREIGN KEY([ROLEID])
REFERENCES [dbo].[T_BAS_ROLE] ([ROLEID])
GO
ALTER TABLE [dbo].[T_BAS_ROLEPNTENTER] CHECK CONSTRAINT [FK_T_BAS_RE_R_T_BAS_R]
GO
/****** Object:  ForeignKey [FK_T_PUBS_R_REFERENCE_T_PUBS_R1]    Script Date: 03/23/2017 14:31:37 ******/
ALTER TABLE [dbo].[T_BAS_ROLESOURCE]  WITH CHECK ADD  CONSTRAINT [FK_T_PUBS_R_REFERENCE_T_PUBS_R1] FOREIGN KEY([ROLEID])
REFERENCES [dbo].[T_BAS_ROLE] ([ROLEID])
GO
ALTER TABLE [dbo].[T_BAS_ROLESOURCE] CHECK CONSTRAINT [FK_T_PUBS_R_REFERENCE_T_PUBS_R1]
GO
/****** Object:  ForeignKey [FK_T_BAS_US_REFERENCE_T_BAS_DE]    Script Date: 03/23/2017 14:31:37 ******/
ALTER TABLE [dbo].[T_BAS_USER]  WITH CHECK ADD  CONSTRAINT [FK_T_BAS_US_REFERENCE_T_BAS_DE] FOREIGN KEY([DEPTID])
REFERENCES [dbo].[T_BAS_DEPTINFO] ([DEPTID])
GO
ALTER TABLE [dbo].[T_BAS_USER] CHECK CONSTRAINT [FK_T_BAS_US_REFERENCE_T_BAS_DE]
GO
/****** Object:  ForeignKey [FK_T_BAS_US_REFERENCE_T_BAS_ME]    Script Date: 03/23/2017 14:31:37 ******/
ALTER TABLE [dbo].[T_BAS_USERMENU]  WITH CHECK ADD  CONSTRAINT [FK_T_BAS_US_REFERENCE_T_BAS_ME] FOREIGN KEY([MENUID])
REFERENCES [dbo].[T_BAS_MENU] ([MENUID])
GO
ALTER TABLE [dbo].[T_BAS_USERMENU] CHECK CONSTRAINT [FK_T_BAS_US_REFERENCE_T_BAS_ME]
GO
/****** Object:  ForeignKey [FK_T_BAS_US_REFERENCE_T_BAS_US]    Script Date: 03/23/2017 14:31:37 ******/
ALTER TABLE [dbo].[T_BAS_USERMENU]  WITH CHECK ADD  CONSTRAINT [FK_T_BAS_US_REFERENCE_T_BAS_US] FOREIGN KEY([USERID])
REFERENCES [dbo].[T_BAS_USER] ([USERID])
GO
ALTER TABLE [dbo].[T_BAS_USERMENU] CHECK CONSTRAINT [FK_T_BAS_US_REFERENCE_T_BAS_US]
GO
/****** Object:  ForeignKey [FK_T_BAS_UE_R_T_BAS_U]    Script Date: 03/23/2017 14:31:37 ******/
ALTER TABLE [dbo].[T_BAS_USERPNTENTER]  WITH CHECK ADD  CONSTRAINT [FK_T_BAS_UE_R_T_BAS_U] FOREIGN KEY([USERID])
REFERENCES [dbo].[T_BAS_USER] ([USERID])
GO
ALTER TABLE [dbo].[T_BAS_USERPNTENTER] CHECK CONSTRAINT [FK_T_BAS_UE_R_T_BAS_U]
GO
/****** Object:  ForeignKey [FK_T_PUBS_U_REFERENCE_T_PUBS_U1]    Script Date: 03/23/2017 14:31:37 ******/
ALTER TABLE [dbo].[T_BAS_USERRESOURCE]  WITH CHECK ADD  CONSTRAINT [FK_T_PUBS_U_REFERENCE_T_PUBS_U1] FOREIGN KEY([USERID])
REFERENCES [dbo].[T_BAS_USER] ([USERID])
GO
ALTER TABLE [dbo].[T_BAS_USERRESOURCE] CHECK CONSTRAINT [FK_T_PUBS_U_REFERENCE_T_PUBS_U1]
GO
/****** Object:  ForeignKey [FK_T_BAS_US_REFERENCE_T_BAS_RO]    Script Date: 03/23/2017 14:31:37 ******/
ALTER TABLE [dbo].[T_BAS_USERROLE]  WITH CHECK ADD  CONSTRAINT [FK_T_BAS_US_REFERENCE_T_BAS_RO] FOREIGN KEY([ROLEID])
REFERENCES [dbo].[T_BAS_ROLE] ([ROLEID])
GO
ALTER TABLE [dbo].[T_BAS_USERROLE] CHECK CONSTRAINT [FK_T_BAS_US_REFERENCE_T_BAS_RO]
GO
/****** Object:  ForeignKey [FK_T_PUBS_U_REFERENCE_T_PUBS_U2]    Script Date: 03/23/2017 14:31:37 ******/
ALTER TABLE [dbo].[T_BAS_USERROLE]  WITH CHECK ADD  CONSTRAINT [FK_T_PUBS_U_REFERENCE_T_PUBS_U2] FOREIGN KEY([USERID])
REFERENCES [dbo].[T_BAS_USER] ([USERID])
GO
ALTER TABLE [dbo].[T_BAS_USERROLE] CHECK CONSTRAINT [FK_T_PUBS_U_REFERENCE_T_PUBS_U2]
GO
/****** Object:  ForeignKey [FK_T_DIC_GE_REFERENCE_T_DIC_GE]    Script Date: 03/23/2017 14:31:37 ******/
ALTER TABLE [dbo].[T_DIC_GENERALCATEGORY]  WITH CHECK ADD  CONSTRAINT [FK_T_DIC_GE_REFERENCE_T_DIC_GE] FOREIGN KEY([CATEGORYCLASS])
REFERENCES [dbo].[T_DIC_GENCATETYPE] ([CATEGORYCLASS])
GO
ALTER TABLE [dbo].[T_DIC_GENERALCATEGORY] CHECK CONSTRAINT [FK_T_DIC_GE_REFERENCE_T_DIC_GE]
GO

/************************************初始化超级管理员数据*********************************/
SET IDENTITY_INSERT [dbo].[T_BAS_USER] ON
INSERT INTO T_BAS_USER (USERID, USERNAME,LOGINNAME,LOGINPW)VALUES(1,'System','System','003b6c87b670a059d67d1fd1d4bec055');
SET IDENTITY_INSERT [dbo].[T_BAS_USER] OFF

/*************************************************初始化通用数据***************************************************/
/************************************初始化按钮数据*********************************/
SET IDENTITY_INSERT [dbo].[T_BAS_BUTTON] ON
INSERT INTO T_BAS_BUTTON (BUTTONID, BUTTONCODE, BUTTONNAME, ORDERNUM) values('1','addType','添加类型','1');
INSERT INTO T_BAS_BUTTON (BUTTONID, BUTTONCODE, BUTTONNAME, ORDERNUM) values('2','add','添加','2');
INSERT INTO T_BAS_BUTTON (BUTTONID, BUTTONCODE, BUTTONNAME, ORDERNUM) values('3','deletes','批量删除','3');
INSERT INTO T_BAS_BUTTON (BUTTONID, BUTTONCODE, BUTTONNAME, ORDERNUM) values('4','edit','编辑','4');
INSERT INTO T_BAS_BUTTON (BUTTONID, BUTTONCODE, BUTTONNAME, ORDERNUM) values('5','delete','删除','5');
INSERT INTO T_BAS_BUTTON (BUTTONID, BUTTONCODE, BUTTONNAME, ORDERNUM) values('10','setMenu','菜单权限','6');
INSERT INTO T_BAS_BUTTON (BUTTONID, BUTTONCODE, BUTTONNAME, ORDERNUM) values('11','assignUserRoles','分配用户','7');
INSERT INTO T_BAS_BUTTON (BUTTONID, BUTTONCODE, BUTTONNAME, ORDERNUM) values('12','export','导出','0');
INSERT INTO T_BAS_BUTTON (BUTTONID, BUTTONCODE, BUTTONNAME, ORDERNUM) values('13','view','详情','13');
INSERT INTO T_BAS_BUTTON (BUTTONID, BUTTONCODE, BUTTONNAME, ORDERNUM) values('14','equipmanage','设备管理','14');
INSERT INTO T_BAS_BUTTON (BUTTONID, BUTTONCODE, BUTTONNAME, ORDERNUM) values('15','showDataFlag','查看标识集','15');
INSERT INTO T_BAS_BUTTON (BUTTONID, BUTTONCODE, BUTTONNAME, ORDERNUM) values('16','resent','补传','16');
INSERT INTO T_BAS_BUTTON (BUTTONID, BUTTONCODE, BUTTONNAME, ORDERNUM) values('17','resentList','补传记录','17');
INSERT INTO T_BAS_BUTTON (BUTTONID, BUTTONCODE, BUTTONNAME, ORDERNUM) values('18','resetPWD','重置密码','17');
INSERT INTO T_BAS_BUTTON (BUTTONID, BUTTONCODE, BUTTONNAME, ORDERNUM) values('19','saveAudit','保存审核数据','18');
SET IDENTITY_INSERT [dbo].[T_BAS_BUTTON] OFF

/************************************初始化字典数据*********************************/
INSERT INTO T_DIC_GENCATETYPE(CATEGORYCLASS,CATEGORYNAME) VALUES('logType','日志类型');
INSERT INTO T_DIC_GENERALCATEGORY (GENERALCODE, CATEGORYNAME, CATEGORYCLASS, ORDERNUM, CSTATUS, REMARK) values('logType0','基本日志','logType',NULL,'1',NULL);
INSERT INTO T_DIC_GENERALCATEGORY (GENERALCODE, CATEGORYNAME, CATEGORYCLASS, ORDERNUM, CSTATUS, REMARK) values('logType1','查看日志','logType',NULL,'1',NULL);
INSERT INTO T_DIC_GENERALCATEGORY (GENERALCODE, CATEGORYNAME, CATEGORYCLASS, ORDERNUM, CSTATUS, REMARK) values('logType2','配置日志','logType',NULL,'1',NULL);
INSERT INTO T_DIC_GENERALCATEGORY (GENERALCODE, CATEGORYNAME, CATEGORYCLASS, ORDERNUM, CSTATUS, REMARK) values('logType5','异常日志','logType',NULL,'1',NULL);

INSERT INTO T_DIC_GENCATETYPE(categoryclass,categoryname) VALUES('alarmLevel','报警级别');
INSERT INTO T_DIC_GENERALCATEGORY (GENERALCODE, CATEGORYNAME, CATEGORYCLASS, ORDERNUM, CSTATUS, REMARK) VALUES('alarmLevel1','一级','alarmLevel','10','1',NULL);
INSERT INTO T_DIC_GENERALCATEGORY (GENERALCODE, CATEGORYNAME, CATEGORYCLASS, ORDERNUM, CSTATUS, REMARK) VALUES('alarmLevel2','二级','alarmLevel','20','1',NULL);
INSERT INTO T_DIC_GENERALCATEGORY (GENERALCODE, CATEGORYNAME, CATEGORYCLASS, ORDERNUM, CSTATUS, REMARK) VALUES('alarmLevel3','三级','alarmLevel','30','1',NULL);

INSERT INTO T_DIC_GENCATETYPE(categoryclass,categoryname) VALUES('menuState','菜单状态');
INSERT INTO T_DIC_GENERALCATEGORY (GENERALCODE, CATEGORYNAME, CATEGORYCLASS, CSTATUS) VALUES('menuState0','停用','menuState',1);
INSERT INTO T_DIC_GENERALCATEGORY (GENERALCODE, CATEGORYNAME, CATEGORYCLASS, CSTATUS) VALUES('menuState1','启用','menuState',1);
 
INSERT INTO  T_DIC_GENCATETYPE(categoryclass,categoryname) VALUES('enable','启用状态');
INSERT INTO T_DIC_GENERALCATEGORY (GENERALCODE, CATEGORYNAME, CATEGORYCLASS, CSTATUS) VALUES('enable0','否','enable',1);
INSERT INTO T_DIC_GENERALCATEGORY (GENERALCODE, CATEGORYNAME, CATEGORYCLASS, CSTATUS) VALUES('enable1','是	','enable',1);


/****** Object:  Table [dbo].[T_DIC_POINTSYSTYPE]    Script Date: 05/22/2017 09:31:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[T_DIC_POINTSYSTYPE](
	[SYSTEMTYPE] [int] NOT NULL,
	[SYSNAME] [nvarchar](50) NULL,
	[TNAMERT] [nvarchar](30) NULL,
	[TNAMEMI] [nvarchar](30) NULL,
	[TNAMEHH] [nvarchar](30) NULL,
	[TNAMEDD] [nvarchar](30) NULL,
	[REMARK] [nvarchar](50) NULL,
	[SNAME] [nvarchar](30) NULL,
	[PNAME] [nvarchar](30) NULL,
	[ATNAMERT] [nvarchar](30) NULL,
	[ATNAMEMI] [nvarchar](30) NULL,
	[ATNAMEHH] [nvarchar](30) NULL,
	[C1] [nvarchar](30) NULL,
	[C2] [nvarchar](30) NULL,
	[TNAMESTAT] [nvarchar](30) NULL,
	[C3] [nvarchar](30) NULL,
	[VALIDTIMEMI] [nvarchar](30) NULL,
 CONSTRAINT [PK_T_DIC_POINTSYSTYPE] PRIMARY KEY NONCLUSTERED 
(
	[SYSTEMTYPE] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'系统代码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_DIC_POINTSYSTYPE', @level2type=N'COLUMN',@level2name=N'SYSTEMTYPE'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'系统名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_DIC_POINTSYSTYPE', @level2type=N'COLUMN',@level2name=N'SYSNAME'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'实时数据表名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_DIC_POINTSYSTYPE', @level2type=N'COLUMN',@level2name=N'TNAMERT'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分钟数据表名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_DIC_POINTSYSTYPE', @level2type=N'COLUMN',@level2name=N'TNAMEMI'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'小时数据表名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_DIC_POINTSYSTYPE', @level2type=N'COLUMN',@level2name=N'TNAMEHH'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'日数据表名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_DIC_POINTSYSTYPE', @level2type=N'COLUMN',@level2name=N'TNAMEDD'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_DIC_POINTSYSTYPE', @level2type=N'COLUMN',@level2name=N'REMARK'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'测站-污染源名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_DIC_POINTSYSTYPE', @level2type=N'COLUMN',@level2name=N'SNAME'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'测点-排口名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_DIC_POINTSYSTYPE', @level2type=N'COLUMN',@level2name=N'PNAME'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'实时数据表名-审核' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_DIC_POINTSYSTYPE', @level2type=N'COLUMN',@level2name=N'ATNAMERT'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分钟数据表名-审核' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_DIC_POINTSYSTYPE', @level2type=N'COLUMN',@level2name=N'ATNAMEMI'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'小时数据表名-审核' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_DIC_POINTSYSTYPE', @level2type=N'COLUMN',@level2name=N'ATNAMEHH'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'扩展列1' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_DIC_POINTSYSTYPE', @level2type=N'COLUMN',@level2name=N'C1'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'扩展列2' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_DIC_POINTSYSTYPE', @level2type=N'COLUMN',@level2name=N'C2'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'统计表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_DIC_POINTSYSTYPE', @level2type=N'COLUMN',@level2name=N'TNAMESTAT'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'扩展列3' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_DIC_POINTSYSTYPE', @level2type=N'COLUMN',@level2name=N'C3'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分钟数据有效时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_DIC_POINTSYSTYPE', @level2type=N'COLUMN',@level2name=N'VALIDTIMEMI'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'字典-测点系统类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_DIC_POINTSYSTYPE'
GO
 
/************************************系统类型初始化数据*********************************/
INSERT INTO T_DIC_POINTSYSTYPE (SYSTEMTYPE, SYSNAME, TNAMERT, TNAMEMI, TNAMEHH, TNAMEDD, REMARK, SNAME, PNAME, ATNAMERT, ATNAMEMI, ATNAMEHH, C1, C2, TNAMESTAT, C3, VALIDTIMEMI) VALUES('21','地表水监测（河流、湖泊和沼泽）','T_ENV_MONI_RIV_DATART','T_ENV_MONI_RIV_DATAMI','T_ENV_MONI_RIV_DATAHH','T_ENV_MONI_RIV_DATADD','ENV','T_ENV_MONI_STATION','T_ENV_MONI_RIVER_STATION',NULL,NULL,NULL,'STATIONNAME','STATIONCODE','T_ENV_MONI_RIV_DATASATA','AVGVALUE',NULL);
INSERT INTO T_DIC_POINTSYSTYPE (SYSTEMTYPE, SYSNAME, TNAMERT, TNAMEMI, TNAMEHH, TNAMEDD, REMARK, SNAME, PNAME, ATNAMERT, ATNAMEMI, ATNAMEHH, C1, C2, TNAMESTAT, C3, VALIDTIMEMI) VALUES('22','空气质量监测','T_ENV_MONI_AIR_DATART','T_ENV_MONI_AIR_DATAMI','T_ENV_MONI_AIR_DATAHH','T_ENV_MONI_AIR_DATADD','ENV','T_ENV_MONI_STATION','T_ENV_MONI_AIR_STATION','T_ENV_MONI_AIR_AUDRT','T_ENV_MONI_AIR_AUDMI','T_ENV_MONI_AIR_AUDDATAHH','STATIONNAME','STATIONCODE','T_ENV_MONI_AIR_DATASATA','AVGVALUE','T_ENV_MONI_AIR_VLDTIMEMI');
INSERT INTO T_DIC_POINTSYSTYPE (SYSTEMTYPE, SYSNAME, TNAMERT, TNAMEMI, TNAMEHH, TNAMEDD, REMARK, SNAME, PNAME, ATNAMERT, ATNAMEMI, ATNAMEHH, C1, C2, TNAMESTAT, C3, VALIDTIMEMI) VALUES('23','区域环境噪声监测','T_ENV_MONI_NOI_DATART','T_ENV_MONI_NOI_DATAMI','T_ENV_MONI_NOI_DATAHH','T_ENV_MONI_NOI_DATADD',NULL,'T_ENV_MONI_STATION','T_ENV_MONI_NOISE_STATION',NULL,NULL,NULL,'STATIONNAME','STATIONCODE','T_ENV_MONI_NOI_DATASATA','AVGVALUE',NULL);
INSERT INTO T_DIC_POINTSYSTYPE (SYSTEMTYPE, SYSNAME, TNAMERT, TNAMEMI, TNAMEHH, TNAMEDD, REMARK, SNAME, PNAME, ATNAMERT, ATNAMEMI, ATNAMEHH, C1, C2, TNAMESTAT, C3, VALIDTIMEMI) VALUES('31','大气环境污染源（烟气）','T_PS_BAS_GAS_DATART','T_PS_BAS_GAS_DATAMI','T_PS_BAS_GAS_DATAHH','T_PS_BAS_GAS_DATADD','PS','T_PS_BAS_ENTERLIST','T_PS_BAS_POINTLIST','T_PS_BAS_GAS_AUDRT','T_PS_BAS_GAS_AUDMI','T_PS_BAS_GAS_AUDDATAHH','PSNAME','PSCODE','T_PS_BAS_GAS_DATASATA','AVGVALUE','T_PS_BAS_GAS_VLDTIMEMI');
INSERT INTO T_DIC_POINTSYSTYPE (SYSTEMTYPE, SYSNAME, TNAMERT, TNAMEMI, TNAMEHH, TNAMEDD, REMARK, SNAME, PNAME, ATNAMERT, ATNAMEMI, ATNAMEHH, C1, C2, TNAMESTAT, C3, VALIDTIMEMI) VALUES('32','地表水体环境污染源（废水）','T_PS_BAS_WAT_DATART','T_PS_BAS_WAT_DATAMI','T_PS_BAS_WAT_DATAHH','T_PS_BAS_WAT_DATADD','PS','T_PS_BAS_ENTERLIST','T_PS_BAS_POINTLIST','T_PS_BAS_WAT_AUDRT','T_PS_BAS_WAT_AUDMI','T_PS_BAS_WAT_AUDDATAHH','PSNAME','PSCODE','T_PS_BAS_WAT_DATASATA','AVGVALUE','T_PS_BAS_WAT_VLDTIMEMI');
INSERT INTO T_DIC_POINTSYSTYPE (SYSTEMTYPE, SYSNAME, TNAMERT, TNAMEMI, TNAMEHH, TNAMEDD, REMARK, SNAME, PNAME, ATNAMERT, ATNAMEMI, ATNAMEHH, C1, C2, TNAMESTAT, C3, VALIDTIMEMI) VALUES('33','地下水体环境污染源',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO T_DIC_POINTSYSTYPE (SYSTEMTYPE, SYSNAME, TNAMERT, TNAMEMI, TNAMEHH, TNAMEDD, REMARK, SNAME, PNAME, ATNAMERT, ATNAMEMI, ATNAMEHH, C1, C2, TNAMESTAT, C3, VALIDTIMEMI) VALUES('34','海洋环境污染源',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO T_DIC_POINTSYSTYPE (SYSTEMTYPE, SYSNAME, TNAMERT, TNAMEMI, TNAMEHH, TNAMEDD, REMARK, SNAME, PNAME, ATNAMERT, ATNAMEMI, ATNAMEHH, C1, C2, TNAMESTAT, C3, VALIDTIMEMI) VALUES('35','土壤环境污染源',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO T_DIC_POINTSYSTYPE (SYSTEMTYPE, SYSNAME, TNAMERT, TNAMEMI, TNAMEHH, TNAMEDD, REMARK, SNAME, PNAME, ATNAMERT, ATNAMEMI, ATNAMEHH, C1, C2, TNAMESTAT, C3, VALIDTIMEMI) VALUES('36','声环境污染源',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO T_DIC_POINTSYSTYPE (SYSTEMTYPE, SYSNAME, TNAMERT, TNAMEMI, TNAMEHH, TNAMEDD, REMARK, SNAME, PNAME, ATNAMERT, ATNAMEMI, ATNAMEHH, C1, C2, TNAMESTAT, C3, VALIDTIMEMI) VALUES('37','振动环境污染源',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO T_DIC_POINTSYSTYPE (SYSTEMTYPE, SYSNAME, TNAMERT, TNAMEMI, TNAMEHH, TNAMEDD, REMARK, SNAME, PNAME, ATNAMERT, ATNAMEMI, ATNAMEHH, C1, C2, TNAMESTAT, C3, VALIDTIMEMI) VALUES('38','放射性环境污染源',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO T_DIC_POINTSYSTYPE (SYSTEMTYPE, SYSNAME, TNAMERT, TNAMEMI, TNAMEHH, TNAMEDD, REMARK, SNAME, PNAME, ATNAMERT, ATNAMEMI, ATNAMEHH, C1, C2, TNAMESTAT, C3, VALIDTIMEMI) VALUES('39','扬尘','T_ENV_MONI_DST_DATART','T_ENV_MONI_DST_DATAMI','T_ENV_MONI_DST_DATAHH','T_ENV_MONI_DST_DATADD','ENV','T_ENV_MONI_STATION','T_ENV_MONI_DUST_STATION',NULL,NULL,NULL,'STATIONNAME','STATIONCODE','T_ENV_MONI_DST_DATASATA','AVGVALUE',NULL);
INSERT INTO T_DIC_POINTSYSTYPE (SYSTEMTYPE, SYSNAME, TNAMERT, TNAMEMI, TNAMEHH, TNAMEDD, REMARK, SNAME, PNAME, ATNAMERT, ATNAMEMI, ATNAMEHH, C1, C2, TNAMESTAT, C3, VALIDTIMEMI) VALUES('40','电磁环境污染源',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO T_DIC_POINTSYSTYPE (SYSTEMTYPE, SYSNAME, TNAMERT, TNAMEMI, TNAMEHH, TNAMEDD, REMARK, SNAME, PNAME, ATNAMERT, ATNAMEMI, ATNAMEHH, C1, C2, TNAMESTAT, C3, VALIDTIMEMI) VALUES('51','工况系统-烟气','T_PS_BAS_PMSG_DATART','T_PS_BAS_PMSG_DATAMI','T_PS_BAS_PMSG_DATAHH','T_PS_BAS_PMSG_DATADD','PS','T_PS_BAS_ENTERLIST','T_PS_BAS_POINTLIST',NULL,NULL,NULL,'PSNAME','PSCODE','T_PS_BAS_PMSG_DATASATA','AVGVALUE',NULL);
INSERT INTO T_DIC_POINTSYSTYPE (SYSTEMTYPE, SYSNAME, TNAMERT, TNAMEMI, TNAMEHH, TNAMEDD, REMARK, SNAME, PNAME, ATNAMERT, ATNAMEMI, ATNAMEHH, C1, C2, TNAMESTAT, C3, VALIDTIMEMI) VALUES('52','工况系统-污水','T_PS_BAS_PMSW_DATART','T_PS_BAS_PMSW_DATAMI','T_PS_BAS_PMSW_DATAHH','T_PS_BAS_PMSW_DATADD','PS','T_PS_BAS_ENTERLIST','T_PS_BAS_POINTLIST',NULL,NULL,NULL,'PSNAME','PSCODE','T_PS_BAS_PMSW_DATASATA',NULL,NULL);
INSERT INTO T_DIC_POINTSYSTYPE (SYSTEMTYPE, SYSNAME, TNAMERT, TNAMEMI, TNAMEHH, TNAMEDD, REMARK, SNAME, PNAME, ATNAMERT, ATNAMEMI, ATNAMEHH, C1, C2, TNAMESTAT, C3, VALIDTIMEMI) VALUES('99','工业特征气体',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO T_DIC_POINTSYSTYPE (SYSTEMTYPE, SYSNAME, TNAMERT, TNAMEMI, TNAMEHH, TNAMEDD, REMARK, SNAME, PNAME, ATNAMERT, ATNAMEMI, ATNAMEHH, C1, C2, TNAMESTAT, C3, VALIDTIMEMI) VALUES('100','机动车尾气',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO T_DIC_POINTSYSTYPE (SYSTEMTYPE, SYSNAME, TNAMERT, TNAMEMI, TNAMEHH, TNAMEDD, REMARK, SNAME, PNAME, ATNAMERT, ATNAMEMI, ATNAMEHH, C1, C2, TNAMESTAT, C3, VALIDTIMEMI) VALUES('101','超级站监测系统',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO T_DIC_POINTSYSTYPE (SYSTEMTYPE, SYSNAME, TNAMERT, TNAMEMI, TNAMEHH, TNAMEDD, REMARK, SNAME, PNAME, ATNAMERT, ATNAMEMI, ATNAMEHH, C1, C2, TNAMESTAT, C3, VALIDTIMEMI) VALUES('102','超级站子站系统',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO T_DIC_POINTSYSTYPE (SYSTEMTYPE, SYSNAME, TNAMERT, TNAMEMI, TNAMEHH, TNAMEDD, REMARK, SNAME, PNAME, ATNAMERT, ATNAMEMI, ATNAMEHH, C1, C2, TNAMESTAT, C3, VALIDTIMEMI) VALUES('103','VOCs固定污染源在线监测系统','T_PS_BAS_VOCS_DATART','T_PS_BAS_VOCS_DATAMI','T_PS_BAS_VOCS_DATAHH','T_PS_BAS_VOCS_DATADD','PS','T_PS_BAS_ENTERLIST','T_PS_BAS_POINTLIST',NULL,NULL,NULL,'PSNAME','PSCODE','T_PS_BAS_VOCS_DATASATA','AVGVALUE',NULL);
INSERT INTO T_DIC_POINTSYSTYPE (SYSTEMTYPE, SYSNAME, TNAMERT, TNAMEMI, TNAMEHH, TNAMEDD, REMARK, SNAME, PNAME, ATNAMERT, ATNAMEMI, ATNAMEHH, C1, C2, TNAMESTAT, C3, VALIDTIMEMI) VALUES('104','油烟系统','T_PS_BAS_SMK_DATART','T_PS_BAS_SMK_DATAMI','T_PS_BAS_SMK_DATAHH','T_PS_BAS_SMK_DATADD','PS','T_PS_BAS_ENTERLIST','T_PS_BAS_POINTLIST','T_PS_BAS_SMK_AUDRT','T_PS_BAS_SMK_AUDMI','T_PS_BAS_SMK_AUDDATAHH','PSNAME','PSCODE','T_PS_BAS_SMK_DATASATA','AVGVALUE','T_PS_BAS_SMK_VLDTIMEMI');
INSERT INTO T_DIC_POINTSYSTYPE (SYSTEMTYPE, SYSNAME, TNAMERT, TNAMEMI, TNAMEHH, TNAMEDD, REMARK, SNAME, PNAME, ATNAMERT, ATNAMEMI, ATNAMEHH, C1, C2, TNAMESTAT, C3, VALIDTIMEMI) VALUES('105','无源扬尘','T_ENV_MONI_DST_DATART','T_ENV_MONI_DST_DATAMI','T_ENV_MONI_DST_DATAHH','T_ENV_MONI_DST_DATADD','ENV','T_ENV_MONI_STATION','T_ENV_MONI_DUST_STATION',NULL,NULL,NULL,NULL,NULL,'T_ENV_MONI_DST_DATASATA',NULL,NULL);
INSERT INTO T_DIC_POINTSYSTYPE (SYSTEMTYPE, SYSNAME, TNAMERT, TNAMEMI, TNAMEHH, TNAMEDD, REMARK, SNAME, PNAME, ATNAMERT, ATNAMEMI, ATNAMEHH, C1, C2, TNAMESTAT, C3, VALIDTIMEMI) VALUES('114','一企一管','T_PS_BAS_YQYG_DATART','T_PS_BAS_YQYG_DATAMI','T_PS_BAS_YQYG_DATAHH','T_PS_BAS_YQYG_DATADD','PS','T_PS_BAS_ENTERLIST','T_PS_BAS_POINTLIST',NULL,NULL,NULL,'PSNAME','PSCODE','T_PS_BAS_YQYG_DATASATA','AVGVALUE',NULL);
INSERT INTO T_DIC_POINTSYSTYPE (SYSTEMTYPE, SYSNAME, TNAMERT, TNAMEMI, TNAMEHH, TNAMEDD, REMARK, SNAME, PNAME, ATNAMERT, ATNAMEMI, ATNAMEHH, C1, C2, TNAMESTAT, C3, VALIDTIMEMI) VALUES('115','园区边界','T_PS_BAS_YQBJ_DATART','T_PS_BAS_YQBJ_DATAMI','T_PS_BAS_YQBJ_DATAHH','T_PS_BAS_YQBJ_DATADD','PS','T_PS_BAS_ENTERLIST','T_PS_BAS_POINTLIST',NULL,NULL,NULL,'PSNAME','PSCODE','T_PS_BAS_YQBJ_DATASATA','AVGVALUE',NULL);

ALTER TABLE T_BAS_ROLEBUTTON ADD BUTTONCODE VARCHAR(100) NULL
GO
ALTER TABLE T_BAS_USERBUTTON ADD BUTTONCODE VARCHAR(100) NULL
GO
SET IDENTITY_INSERT T_BAS_BUTTON ON
INSERT INTO T_BAS_BUTTON (BUTTONID, BUTTONCODE, BUTTONNAME, ORDERNUM) VALUES('20','setPoint','站点权限','19');
SET IDENTITY_INSERT T_BAS_BUTTON OFF
UPDATE T_BAS_ROLEBUTTON SET BUTTONCODE='setPoint' WHERE ID=1;
UPDATE T_BAS_USERBUTTON SET BUTTONCODE='setPoint' WHERE ID=1;

/********************************************初始化菜单数据--系统管理***************************************************/
DELETE FROM T_BAS_BUTTONMENU WHERE MENUID IN( SELECT MENUID FROM T_BAS_MENU WHERE MENUCODE=9999);
DELETE FROM T_BAS_USERMENU WHERE MENUID IN( SELECT MENUID FROM T_BAS_MENU WHERE MENUCODE=9999);
DELETE FROM T_BAS_ROLEMEUN WHERE MENUID IN( SELECT MENUID FROM T_BAS_MENU WHERE MENUCODE=9999);
DELETE FROM T_BAS_MENU WHERE MENUCODE=9999;

SET IDENTITY_INSERT [dbo].[T_BAS_MENU] ON
INSERT INTO T_BAS_MENU (MENUID, MENUNAME, MENUURL, MENUPIC, PID, MENUCODE, STYPE, ORDERNUM, MSTATUS) values('9999','系统管理',NULL,'framework/images/system-admin.png',NULL,'9999',1,'100','1');
INSERT INTO T_BAS_MENU (MENUID, MENUNAME, MENUURL, MENUPIC, PID, MENUCODE, STYPE, ORDERNUM, MSTATUS) values('99','系统配置',NULL,'framework/images/system-admin.png',NULL,'9999',NULL,'100','1');
INSERT INTO T_BAS_MENU (MENUID, MENUNAME, MENUURL, MENUPIC, PID, MENUCODE, STYPE, ORDERNUM, MSTATUS) values('9901','角色管理','/bfs/views/bfs/roleInfo.html',NULL,'99','9999',NULL,'145','1');
INSERT INTO T_BAS_MENU (MENUID, MENUNAME, MENUURL, MENUPIC, PID, MENUCODE, STYPE, ORDERNUM, MSTATUS) values('9902','用户管理','/bfs/views/bfs/userInfo.html',NULL,'99','9999',NULL,'140','1');
INSERT INTO T_BAS_MENU (MENUID, MENUNAME, MENUURL, MENUPIC, PID, MENUCODE, STYPE, ORDERNUM, MSTATUS) values('9903','部门信息维护','/bfs/views/bfs/deptInfo.html',NULL,'99','9999',NULL,'146','1');
INSERT INTO T_BAS_MENU (MENUID, MENUNAME, MENUURL, MENUPIC, PID, MENUCODE, STYPE, ORDERNUM, MSTATUS) values('9904','修改密码','/bfs/views/bfs/rePassWord.html',NULL,'99','9999',NULL,'135','1');
INSERT INTO T_BAS_MENU (MENUID, MENUNAME, MENUURL, MENUPIC, PID, MENUCODE, STYPE, ORDERNUM, MSTATUS) values('9905','区域配置','/gems/views/mcs/areaCode.html',NULL,'99','9999',NULL,'130','1');
INSERT INTO T_BAS_MENU (MENUID, MENUNAME, MENUURL, MENUPIC, PID, MENUCODE, STYPE, ORDERNUM, MSTATUS) values('9906','字典管理','/bfs/views/bfs/dataDictionary.html',NULL,'99','9999',NULL,'100','1');
INSERT INTO T_BAS_MENU (MENUID, MENUNAME, MENUURL, MENUPIC, PID, MENUCODE, STYPE, ORDERNUM, MSTATUS) values('9907','系统日志','/bfs/views/bfs/logManagement.html',NULL,'99','9999',NULL,'100','1');
INSERT INTO T_BAS_MENU (MENUID, MENUNAME, MENUURL, MENUPIC, PID, MENUCODE, STYPE, ORDERNUM, MSTATUS) values('9908','菜单管理','/bfs/views/bfs/menu.html',NULL,'99','9999',NULL,'147','1');
INSERT INTO T_BAS_MENU (MENUID, MENUNAME, MENUURL, MENUPIC, PID, MENUCODE, STYPE, ORDERNUM, MSTATUS) values('9909','河流配置','/gems/views/mcs/wsystemStream.html',NULL,'99','9999',NULL,'120','1');
INSERT INTO T_BAS_MENU (MENUID, MENUNAME, MENUURL, MENUPIC, PID, MENUCODE, STYPE, ORDERNUM, MSTATUS) values('9910','流域管理','/gems/views/mcs/wsystemRiver.html',NULL,'99','9999',NULL,'125','1');

INSERT INTO T_BAS_MENU (MENUID, MENUNAME, MENUURL, MENUPIC, PID, MENUCODE, STYPE, ORDERNUM, MSTATUS) VALUES (10, '排污许可证智能分析系统', NULL, 'framework/images/system-admin.png', NULL, '10', 1, 0, 1);
INSERT INTO T_BAS_MENU (MENUID, MENUNAME, MENUURL, MENUPIC, PID, MENUCODE, STYPE, ORDERNUM, MSTATUS) VALUES (1010, 'GIS一张图', NULL, 'framework/images/revise.png', NULL, '10', NULL, 10, 1);
INSERT INTO T_BAS_MENU (MENUID, MENUNAME, MENUURL, MENUPIC, PID, MENUCODE, STYPE, ORDERNUM, MSTATUS) VALUES (101001, '排污许可企业专题图', '/pls/views/gis/subject/enterprise.html', '', 1010, '10', NULL, 10, 1);
INSERT INTO T_BAS_MENU (MENUID, MENUNAME, MENUURL, MENUPIC, PID, MENUCODE, STYPE, ORDERNUM, MSTATUS) VALUES (101003, '排放量专题图', '/pls/views/gis/subject/emission.html', NULL, 1010, '10', NULL, 8, 1);
INSERT INTO T_BAS_MENU (MENUID, MENUNAME, MENUURL, MENUPIC, PID, MENUCODE, STYPE, ORDERNUM, MSTATUS) VALUES (101005, '违法企业专题图', '/pls/views/gis/subject/illegal.html', NULL, 1010, '10', NULL, 6, 1);
INSERT INTO T_BAS_MENU (MENUID, MENUNAME, MENUURL, MENUPIC, PID, MENUCODE, STYPE, ORDERNUM, MSTATUS) VALUES (101010, '许可证到期预警', '', '', 101011, '10', NULL, 9, 1);
INSERT INTO T_BAS_MENU (MENUID, MENUNAME, MENUURL, MENUPIC, PID, MENUCODE, STYPE, ORDERNUM, MSTATUS) VALUES (101002, '排污口专题图', '/pls/views/gis/subject/point.html', NULL, 1010, '10', NULL, 9, 1);
INSERT INTO T_BAS_MENU (MENUID, MENUNAME, MENUURL, MENUPIC, PID, MENUCODE, STYPE, ORDERNUM, MSTATUS) VALUES (101008, '多维对比', NULL, 'framework/images/revise.png', NULL, '10', NULL, 8, 1);
INSERT INTO T_BAS_MENU (MENUID, MENUNAME, MENUURL, MENUPIC, PID, MENUCODE, STYPE, ORDERNUM, MSTATUS) VALUES (101009, '许可发放情况', '', '', 101011, '10', NULL, 10, 1);
INSERT INTO T_BAS_MENU (MENUID, MENUNAME, MENUURL, MENUPIC, PID, MENUCODE, STYPE, ORDERNUM, MSTATUS) VALUES (101011, '许可证统计', NULL, 'framework/images/revise.png', NULL, '10', NULL, 7, 1);
INSERT INTO T_BAS_MENU (MENUID, MENUNAME, MENUURL, MENUPIC, PID, MENUCODE, STYPE, ORDERNUM, MSTATUS) VALUES (101012, '企业管控级别统计', NULL, NULL, 101011, '10', NULL, 8, 1);
INSERT INTO T_BAS_MENU (MENUID, MENUNAME, MENUURL, MENUPIC, PID, MENUCODE, STYPE, ORDERNUM, MSTATUS) VALUES (101013, '排放量统计', '', 'framework/images/revise.png', NULL, '10', NULL, 6, 1);
INSERT INTO T_BAS_MENU (MENUID, MENUNAME, MENUURL, MENUPIC, PID, MENUCODE, STYPE, ORDERNUM, MSTATUS) VALUES (101015, '实际排放量统计', NULL, '', 101013, '10', NULL, 9, 1);
INSERT INTO T_BAS_MENU (MENUID, MENUNAME, MENUURL, MENUPIC, PID, MENUCODE, STYPE, ORDERNUM, MSTATUS) VALUES (101004, '许可证到期预警专题图', '/pls/views/gis/subject/expireAlarm.html', NULL, 1010, '10', NULL, 7, 1);
INSERT INTO T_BAS_MENU (MENUID, MENUNAME, MENUURL, MENUPIC, PID, MENUCODE, STYPE, ORDERNUM, MSTATUS) VALUES (101006, '环境质量与排污关系专题图', '/pls/views/gis/subject/enviormentPollute.html', NULL, 1010, '10', NULL, 5, 1);
INSERT INTO T_BAS_MENU (MENUID, MENUNAME, MENUURL, MENUPIC, PID, MENUCODE, STYPE, ORDERNUM, MSTATUS) VALUES (101007, '信息综合', '', 'framework/images/revise.png', NULL, '10', NULL, 9, 1);
INSERT INTO T_BAS_MENU (MENUID, MENUNAME, MENUURL, MENUPIC, PID, MENUCODE, STYPE, ORDERNUM, MSTATUS) VALUES (101014, '许可排放量统计', NULL, '', 101013, '10', NULL, 10, 1);
INSERT INTO T_BAS_MENU (MENUID, MENUNAME, MENUURL, MENUPIC, PID, MENUCODE, STYPE, ORDERNUM, MSTATUS) VALUES (101016, '环境与排污', NULL, 'framework/images/revise.png', NULL, '10', NULL, 5, 1);
INSERT INTO T_BAS_MENU (MENUID, MENUNAME, MENUURL, MENUPIC, PID, MENUCODE, STYPE, ORDERNUM, MSTATUS) VALUES (101017, '决策驾驶舱', NULL, 'framework/images/revise.png', NULL, '10', NULL, 4, 1);
SET IDENTITY_INSERT [dbo].[T_BAS_MENU] OFF

INSERT INTO T_BAS_BUTTONMENU (BUTTONID, MENUID) values('2','9901');
INSERT INTO T_BAS_BUTTONMENU (BUTTONID, MENUID) values('3','9901');
INSERT INTO T_BAS_BUTTONMENU (BUTTONID, MENUID) values('4','9901');
INSERT INTO T_BAS_BUTTONMENU (BUTTONID, MENUID) values('5','9901');
INSERT INTO T_BAS_BUTTONMENU (BUTTONID, MENUID) values('10','9901');
INSERT INTO T_BAS_BUTTONMENU (BUTTONID, MENUID) values('11','9901');
INSERT INTO T_BAS_BUTTONMENU (BUTTONID, MENUID) VALUES('20','9901');
INSERT INTO T_BAS_BUTTONMENU (BUTTONID, MENUID) values('2','9902');
INSERT INTO T_BAS_BUTTONMENU (BUTTONID, MENUID) values('3','9902');
INSERT INTO T_BAS_BUTTONMENU (BUTTONID, MENUID) values('4','9902');
INSERT INTO T_BAS_BUTTONMENU (BUTTONID, MENUID) values('5','9902');
INSERT INTO T_BAS_BUTTONMENU (BUTTONID, MENUID) values('18','9902');
INSERT INTO T_BAS_BUTTONMENU (BUTTONID, MENUID) values('20','9902');
INSERT INTO T_BAS_BUTTONMENU (BUTTONID, MENUID) values('2','9903');
INSERT INTO T_BAS_BUTTONMENU (BUTTONID, MENUID) values('3','9903');
INSERT INTO T_BAS_BUTTONMENU (BUTTONID, MENUID) values('4','9903');
INSERT INTO T_BAS_BUTTONMENU (BUTTONID, MENUID) values('5','9903');
INSERT INTO T_BAS_BUTTONMENU (BUTTONID, MENUID) values('2','9905');
INSERT INTO T_BAS_BUTTONMENU (BUTTONID, MENUID) values('3','9905');
INSERT INTO T_BAS_BUTTONMENU (BUTTONID, MENUID) values('4','9905');
INSERT INTO T_BAS_BUTTONMENU (BUTTONID, MENUID) values('5','9905');
INSERT INTO T_BAS_BUTTONMENU (BUTTONID, MENUID) values('1','9906');
INSERT INTO T_BAS_BUTTONMENU (BUTTONID, MENUID) values('2','9906');
INSERT INTO T_BAS_BUTTONMENU (BUTTONID, MENUID) values('3','9906');
INSERT INTO T_BAS_BUTTONMENU (BUTTONID, MENUID) values('4','9906');
INSERT INTO T_BAS_BUTTONMENU (BUTTONID, MENUID) values('5','9906');
INSERT INTO T_BAS_BUTTONMENU (BUTTONID, MENUID) values('2','9908');
INSERT INTO T_BAS_BUTTONMENU (BUTTONID, MENUID) values('3','9908');
INSERT INTO T_BAS_BUTTONMENU (BUTTONID, MENUID) values('4','9908');
INSERT INTO T_BAS_BUTTONMENU (BUTTONID, MENUID) values('5','9908');
INSERT INTO T_BAS_BUTTONMENU (BUTTONID, MENUID) values('2','9909');
INSERT INTO T_BAS_BUTTONMENU (BUTTONID, MENUID) values('3','9909');
INSERT INTO T_BAS_BUTTONMENU (BUTTONID, MENUID) values('4','9909');
INSERT INTO T_BAS_BUTTONMENU (BUTTONID, MENUID) values('5','9909');
INSERT INTO T_BAS_BUTTONMENU (BUTTONID, MENUID) values('2','9910');
INSERT INTO T_BAS_BUTTONMENU (BUTTONID, MENUID) values('3','9910');
INSERT INTO T_BAS_BUTTONMENU (BUTTONID, MENUID) values('4','9910');
INSERT INTO T_BAS_BUTTONMENU (BUTTONID, MENUID) values('5','9910');

INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9999','1','0','1','1',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('99','1','0','1','1',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9901','1','0','1','1',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9901','1','2','1','2',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9901','1','3','1','2',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9901','1','4','1','2',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9901','1','5','1','2',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9901','1','10','1','2',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9901','1','11','1','2',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9901','1','20','1','2',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9902','1','0','1','1',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9902','1','2','1','2',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9902','1','3','1','2',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9902','1','4','1','2',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9902','1','5','1','2',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9902','1','18','1','2',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9902','1','20','1','2',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9903','1','0','1','1',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9903','1','2','1','2',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9903','1','3','1','2',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9903','1','4','1','2',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9903','1','5','1','2',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9904','1','0','1','1',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9905','1','0','1','1',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9905','1','2','1','2',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9905','1','3','1','2',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9905','1','4','1','2',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9905','1','5','1','2',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9906','1','0','1','1',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9906','1','1','1','2',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9906','1','2','1','2',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9906','1','3','1','2',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9906','1','4','1','2',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9906','1','5','1','2',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9907','1','0','1','1',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9908','1','0','1','1',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9908','1','2','1','2',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9908','1','3','1','2',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9908','1','4','1','2',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9908','1','5','1','2',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9909','1','0','1','1',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9909','1','2','1','2',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9909','1','3','1','2',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9909','1','4','1','2',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9909','1','5','1','2',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9910','1','0','1','1',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9910','1','2','1','2',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9910','1','3','1','2',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9910','1','4','1','2',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('9910','1','5','1','2',NULL,NULL);

INSERT INTO  T_BAS_USERMENU(MENUID, USERID, BUTTONID, CREATEID, CREATETIME, ORDERNUM, TYPE) VALUES (10, 1, -1, 1, NULL, NULL, 1);
INSERT INTO  T_BAS_USERMENU(MENUID, USERID, BUTTONID, CREATEID, CREATETIME, ORDERNUM, TYPE) VALUES (1010, 1, -1, 1, NULL, NULL, 1);
INSERT INTO  T_BAS_USERMENU(MENUID, USERID, BUTTONID, CREATEID, CREATETIME, ORDERNUM, TYPE) VALUES (101002, 1, -1, 1, NULL, NULL, 1);
INSERT INTO  T_BAS_USERMENU(MENUID, USERID, BUTTONID, CREATEID, CREATETIME, ORDERNUM, TYPE) VALUES (101004, 1, -1, 1, NULL, NULL, 1);
INSERT INTO  T_BAS_USERMENU(MENUID, USERID, BUTTONID, CREATEID, CREATETIME, ORDERNUM, TYPE) VALUES (101006, 1, -1, 1, NULL, NULL, 1);
INSERT INTO  T_BAS_USERMENU(MENUID, USERID, BUTTONID, CREATEID, CREATETIME, ORDERNUM, TYPE) VALUES (101007, 1, -1, 1, NULL, NULL, 1);
INSERT INTO  T_BAS_USERMENU(MENUID, USERID, BUTTONID, CREATEID, CREATETIME, ORDERNUM, TYPE) VALUES (101008, 1, -1, 1, NULL, NULL, 1);
INSERT INTO  T_BAS_USERMENU(MENUID, USERID, BUTTONID, CREATEID, CREATETIME, ORDERNUM, TYPE) VALUES (101009, 1, -1, 1, NULL, NULL, 1);
INSERT INTO  T_BAS_USERMENU(MENUID, USERID, BUTTONID, CREATEID, CREATETIME, ORDERNUM, TYPE) VALUES (101011, 1, -1, 1, NULL, NULL, 1);
INSERT INTO  T_BAS_USERMENU(MENUID, USERID, BUTTONID, CREATEID, CREATETIME, ORDERNUM, TYPE) VALUES (101012, 1, -1, 1, NULL, NULL, 1);
INSERT INTO  T_BAS_USERMENU(MENUID, USERID, BUTTONID, CREATEID, CREATETIME, ORDERNUM, TYPE) VALUES (101013, 1, -1, 1, NULL, NULL, 1);
INSERT INTO  T_BAS_USERMENU(MENUID, USERID, BUTTONID, CREATEID, CREATETIME, ORDERNUM, TYPE) VALUES (101014, 1, -1, 1, NULL, NULL, 1);
INSERT INTO  T_BAS_USERMENU(MENUID, USERID, BUTTONID, CREATEID, CREATETIME, ORDERNUM, TYPE) VALUES (101015, 1, -1, 1, NULL, NULL, 1);
INSERT INTO  T_BAS_USERMENU(MENUID, USERID, BUTTONID, CREATEID, CREATETIME, ORDERNUM, TYPE) VALUES (101016, 1, -1, 1, NULL, NULL, 1);
INSERT INTO  T_BAS_USERMENU(MENUID, USERID, BUTTONID, CREATEID, CREATETIME, ORDERNUM, TYPE) VALUES (101001, 1, -1, 1, NULL, NULL, 1);
INSERT INTO  T_BAS_USERMENU(MENUID, USERID, BUTTONID, CREATEID, CREATETIME, ORDERNUM, TYPE) VALUES (101003, 1, -1, 1, NULL, NULL, 1);
INSERT INTO  T_BAS_USERMENU(MENUID, USERID, BUTTONID, CREATEID, CREATETIME, ORDERNUM, TYPE) VALUES (101005, 1, -1, 1, NULL, NULL, 1);
INSERT INTO  T_BAS_USERMENU(MENUID, USERID, BUTTONID, CREATEID, CREATETIME, ORDERNUM, TYPE) VALUES (101010, 1, -1, 1, NULL, NULL, 1);
INSERT INTO  T_BAS_USERMENU(MENUID, USERID, BUTTONID, CREATEID, CREATETIME, ORDERNUM, TYPE) VALUES (101017, 1, -1, 1, NULL, NULL, 1);


/**
 * 日期：2017.12.18
 * 作者：卢茂林
 * 描述：更新系统桌面菜单为项目定制化界面菜单
 */
SET IDENTITY_INSERT [dbo].[T_BAS_MENU] ON
INSERT INTO T_BAS_MENU (MENUID, MENUNAME, MENUURL, MENUPIC, PID, MENUCODE, STYPE, ORDERNUM, MSTATUS) values('20','污染源全生命周期信息查询系统',NULL,'framework/images/system20.png',NULL,'20',1,'101','1');
INSERT INTO T_BAS_MENU (MENUID, MENUNAME, MENUURL, MENUPIC, PID, MENUCODE, STYPE, ORDERNUM, MSTATUS) values('30','环境信息公开平台',NULL,'framework/images/system30.png',NULL,'30',1,'102','1');
SET IDENTITY_INSERT [dbo].[T_BAS_MENU] OFF

INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('20','1','0','1','1',NULL,NULL);
INSERT INTO T_BAS_USERMENU (MENUID, USERID, BUTTONID, CREATEID, TYPE, CREATETIME, ORDERNUM) values('30','1','0','1','1',NULL,NULL);

UPDATE T_BAS_MENU SET ORDERNUM=110 WEHRE MENUID=10;
UPDATE T_BAS_MENU SET ORDERNUM=109 WEHRE MENUID=20;
UPDATE T_BAS_MENU SET ORDERNUM=108 WEHRE MENUID=30;
